home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / internet / irc_i_dodatki / narratorinstall / amirc / rexx / narrator.amirx
Text File  |  1997-05-27  |  3KB  |  129 lines

  1. /* $VER: Narrator.amirx 1.23 (25.05.97) Neil Ross <aspect@direct.ca> */
  2. signal on syntax
  3. OPTIONS RESULTS
  4. nickwch=0
  5. wds=1
  6. cs=''
  7. cd=''
  8. IF~SHOW('L','rexxsupport.library') THEN IF~ADDLIB('rexxsupport.library',0,-30,0) THEN DO
  9. CALL narmes('rexxsupport.library not available, exiting...')
  10. EXIT
  11. END
  12. IF SHOW('P','NARRATOR') THEN DO
  13. CALL NARMES('The Narrator is already running!')
  14. EXIT
  15. END
  16. PRAGMA(S,20000)
  17. ADDRESS COMMAND 'run <>NIL: sys:rexxc/muirexx Narrator/NarratorGUI.rexx port NARRATOR HELP Narrator.guide'
  18. CALL SETCLIP('NR_INIT','0')
  19. DO UNTIL GETCLIP('NR_INIT')='1'
  20. CALL DELAY(25)
  21. END
  22. CALL getme()
  23. CALL NARMES('Setting up, please wait...')
  24. DO WHILE GETCLIP('NR_INIT')~='3'
  25. IF GETCLIP('NR_STAT')='1' THEN DO
  26. CALL SETCLIP('NR_STAT','0')
  27. rvoice=getclip(NR_RVOIC)
  28. smiley=getclip(NR_SMILE)
  29. yflood=getclip(NR_YFLOO)
  30. prvmsg=getclip(NR_PRVMS)
  31. sp=getclip(NR_SPEED)
  32. pt=getclip(NR_PITCH)
  33. in=getclip(NR_INFLE)
  34. SELECT
  35. WHEN rvoice=1 THEN in='N'
  36. WHEN in=0 THEN in='F'
  37. WHEN in=1 THEN in='M'
  38. WHEN in=3 THEN in='R'
  39. OTHERWISE in=2
  40. END
  41. cl=SHOW('C')
  42. ct=WORDS(cl)
  43. DO i=1 TO ct
  44. PARSE VAR cl cc.i cl
  45. IF SUBSTR(cc.i,1,4)='NR_§' THEN cs=cc.i||" "||cs
  46. END
  47. cc=WORDS(cs)
  48. DO i=1 TO cc
  49. PARSE VAR cs cd.i cs
  50. END
  51. CALL SETCLIP('NR_STAT','0')
  52. CALL SETCLIP('NR_INIT','1')
  53. CALL NARMES('Settings loaded...')
  54. END
  55. CALL cruncher()
  56. END
  57. CALL NARMES('The Narrator has been silenced...')
  58. EXIT
  59. cruncher:
  60. "GETLINE"
  61. IF GETCLIP('NR_INIT')=1 THEN DO
  62. whisper=DELSTR(LINE.REST,1,1)
  63. nicker=LINE.PREFIX
  64. msgtyp=LINE.COMMAND
  65. IF msgtyp~='PRIVMSG' THEN RETURN
  66. IF yflood~=1 THEN DO
  67. IF oldnck=nicker
  68. THEN nickwch=nickwch+1
  69. ELSE nickwch=0
  70. oldnck=nicker
  71. IF nickwch>0 THEN RETURN
  72. END
  73. IF prvmsg=1 THEN DO
  74. IF UPPER(line.dest)~=UPPER(mynick) THEN RETURN
  75. END
  76. wds=WORDS(whisper)
  77. IF smiley=1 THEN DO
  78. DO wrdn=1 TO wds
  79. DO i=1 TO cc
  80. cr=SUBSTR(cd.i,5)
  81. IF cr=WORD(whisper,wrdn) THEN DO
  82. cp=GETCLIP(cd.i)
  83. wpos=WORDINDEX(whisper,wrdn)
  84. CALL swapsmiley(cp)
  85. ITERATE wrdn
  86. END
  87. END
  88. END
  89. END
  90. IF rvoice=1 THEN DO
  91. sp=TRUNC(6*wds+54)
  92. IF sp<144 THEN sp=144
  93. IF sp>400 THEN sp=400
  94. pt=Random(65,320,Time(secs))
  95. END
  96. CALL OPEN(speaker,"SPEAK:OPT/a0/o0/"||in||"/p"||pt||"/s"||sp,'W')
  97. CALL WRITELN(speaker,TRANSLATE(whisper,'          ',':~^*/<>=''"'))
  98. CALL CLOSE(speaker)
  99. END
  100. ELSE CALL DELAY(25)
  101. RETURN
  102. swapsmiley:
  103. whisper=INSERT(arg(1)||" ",DELWORD(whisper,wrdn,1),wpos-1)
  104. RETURN
  105. narmes:
  106. IF ARG(1)~='' THEN 'ECHO P='D2C(27)'b«Narrator» '||ARG(1)
  107. RETURN
  108. getme:
  109. "GETMYNICK"
  110. mynick=result
  111. "USERHOST "||mynick
  112. myserv=result
  113. me=mynick||"!"||myserv
  114. RETURN
  115. syntax:
  116. IF SIGL=93 THEN DO
  117. CALL NARMES('Speak device not avaiable!')
  118. EXIT
  119. END
  120. l=rc
  121. erb="ERROR "||l||":"||ERRORTEXT(l)
  122. erc="LINE "||SIGL||":"||SOURCELINE(SIGL)
  123. "SAY /msg "||mynick||" You have found a bug!"
  124. "SAY /msg "||mynick||"---"
  125. "SAY /msg "||mynick||" "||erb
  126. "SAY /msg "||mynick||" "||erc
  127. "SAY /msg "||mynick||"---"
  128. "SAY /msg "||mynick||" Please send the above lines by E-Mail to aspect@direct.ca"
  129. EXIT